package edu.ncu.dao;

import edu.ncu.entity.News;
import edu.ncu.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface NewsDao {
    @Select("select * from news;")
    List<News> findAll();

    @Insert("insert into news (newsTitle, newsContent, newsHtmlAddress, newsPublishTime) " +
            "values(#{newsTitle}, #{newsContent}, #{newsHtmlAddress}, #{newsPublishTime};")
    int saveNews(News news);

    @Delete("delete from news where newsId = #{newsId};")
    int deleteNews(int newsId);
}